<#--Created by IntelliJ IDEA.
User: zxm
Date: 2017/12/20
Time: 10:00
To change this template use File | Settings | File Templates.-->

<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title>编辑监理单位</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
        content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
  <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css">
  <link rel="stylesheet" href="${re.contextPath}/plugin/ztree/css/metroStyle/metroStyle.css">
  <!--公用样式-->
  <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/comment.css">
  <!--页面样式-->
  <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/style.css">
  <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/extended.css">
  <script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
  <script type="text/javascript" src="${re.contextPath}/plugin/layui2.2/layui.all.js"
          charset="utf-8"></script>
  <script type="text/javascript"
          charset="utf-8"></script>
  <script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
  <script type="text/javascript" src="${re.contextPath}/plugin/tools/update-setting.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            var flag='${detail}';
            if(flag){
                $("form").disable();
            }
        });
    </script>
  <script type="text/javascript">


    (function ($) {
      $.fn.disable = function () {
        return $(this).find("*").each(function () {
          $(this).attr("disabled", "disabled");
        });
      }
    })(jQuery);
  </script>
  <script type="text/javascript">
    $(document).ready(function () {
      var flag = '${detail}';
      if (flag) {
        $("form").disable();
      }
    });
  </script>
</head>

<body>
<div class="x-body">
  <form class="layui-form layui-form-pane" style="margin-left: 20px;">
    <input type="hidden" value="${CompanyOwner.bcId}" name = "bcId">
    <div style="width:100%;height:300px;overflow: auto;">
      <div class="layui-form-item">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
          <legend style="font-size:16px;">监理单位信息</legend>
        </fieldset>
      </div>
      <div class="layui-form-item">
        <label for="bcName" class="layui-form-label w15p">
          <span class="red">*</span>名称
        </label>
        <div class="layui-input-inline w80p">
          <input type="text" id="bcName" name="bcName" lay-verify="bcName" value="${CompanyOwner.bcName}"
                 autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label for="bcDwxz" class="layui-form-label w15p">
          <span class="red">*</span>单位性质
        </label>
        <div class="layui-input-inline w80p">
          <select name="bcDwxz" id="bcDwxz" class="ml8 fl" lay-filter="county" lay-verify="required"
                  style="width:80%!important;margin-left: 10px" lay-ignore>
            <option value="">请选择</option>
              <option value="001"
                      <#if "${CompanyOwner.bcDwxz}"=="001">
                        selected
                      </#if>
              >企业</option>
            <option value="002"
                    <#if "${CompanyOwner.bcDwxz}"=="002">
                      selected
                    </#if>
            >机关</option>
          </select>
        </div>
      </div>

      <div class="layui-form-item">
        <label for="bcJgdm" class="layui-form-label w15p">
          机构代码
        </label>
        <div class="layui-input-inline w80p">
          <input type="text" id="bcJgdm" name="bcJgdm" lay-verify="bcJgdm" autocomplete="off" value="${CompanyOwner.bcJgdm}"
                 class="layui-input">
        </div>
      </div>

      <div class="layui-form-item">
        <label for="bcAddress" class="layui-form-label w15p">
          地址
        </label>
        <div class="layui-input-inline w80p">
          <input type="text" id="bcAddress" name="bcAddress" lay-verify="bcAddress" autocomplete="off" value="${CompanyOwner.bcAddress}"
                 class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label for="bcNote" class="layui-form-label w15p">
          备注
        </label>
        <div class="layui-input-inline w80p">
          <input type="text" id="bcNote" name="bcNote" lay-verify="bcNote" autocomplete="off" value="${CompanyOwner.bcNote}"
                 class="layui-input">
        </div>
      </div>

      <div style="height: 60px"></div>
    </div>
  <#if !detail>
    <div style="width: 100%;height: 55px;background-color: white;border-top:1px solid #e6e6e6;
  position: fixed;bottom: 1px;margin-left:-20px;">
      <div class="layui-form-item" style=" float: right;margin-right: 30px;margin-top: 8px">

        <button class="layui-btn layui-btn-normal" lay-filter="add" lay-submit>
          确认
        </button>
        <button class="layui-btn layui-btn-primary" id="close">
          取消
        </button>
      </div>
    </div>
  </#if>
  </form>
</div>
<script>
  layui.use(['form', 'layer'], function () {
    $ = layui.jquery;
    var form = layui.form
        , layer = layui.layer;

    //自定义验证规则
    form.verify({
      roleName: function (value) {
        if (value.trim() == "") {
          return "角色名不能为空";
        }
      }
    });

    $('#close').click(function () {
      var index = parent.layer.getFrameIndex(window.name);
      parent.layer.close(index);
    });
    //监听提交
    form.on('submit(add)', function (data) {

      layerAjax('updateCompanyOwner', data.field, 'companyList');
      return false;
    });
  });
</script>
</body>

</html>
